package com.szrt.javaweb.ch01.dyn.aop;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.springframework.stereotype.Repository;


public class YmactorDaoImpl implements ActorDao{
	
	private boolean mustRestoreAutoCommit;
	
	
	
	
	

	@Override
	public String toString() {
		return "YmactorDaoImpl [mustRestoreAutoCommit=" + mustRestoreAutoCommit + "]";
	}

	public boolean isMustRestoreAutoCommit() {
		return mustRestoreAutoCommit;
	}

	public void setMustRestoreAutoCommit(boolean mustRestoreAutoCommit) {
		this.mustRestoreAutoCommit = mustRestoreAutoCommit;
	}

	@Override
	public void act() {
		
		System.out.println("杨幂演三生三世...");
	}

	@Override
	public int add(int a, int b) {
		int sum = a+b;
		System.out.println("进入add方法"+sum);
		return sum;
	}

	@Override
	public String insert(String name, Integer age) {
		
		//1 获得连接
		
		String sql = "INSERT INTO spring_teacher_t (TEACHER_NAME2,TEACHER_AGE) VALUES(?,?)";
		return sql;
	}

}
